using MicroMsg.Storage;
using MicroMsg.UI.Util;
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media.Imaging;
namespace MicroMsg.UI.UserContrl
{
	public class ScrollPicsCtrlArgs
	{
		public List<TloMedia> mListSnsImg;
		public int mNFirstPicIndex = -1;
		public MMUIEvent mDlgShow;
		public MMUIEvent mDlgHide;
		public WriteableBitmap mImgBack;
		public List<BitmapImage> mListThumbImg;
		public List<Rect> mListOriginPos;
		public Panel mPanelHolder;
		public bool mBIsNeedAnimation = true;
		public ScrollPicsCtrlArgs(List<TloMedia> listSnsImg, List<BitmapImage> listThumbImgs, int nFirstPicIndex, bool bIsNeedAnimation = true)
		{
			this.mListSnsImg = listSnsImg;
			this.mListThumbImg = listThumbImgs;
			this.mNFirstPicIndex = nFirstPicIndex;
			this.mBIsNeedAnimation = bIsNeedAnimation;
		}
		public ScrollPicsCtrlArgs(CirclePagePicsCtrl picsCtrl, int nFIndex, MMUIEvent dlgStart, MMUIEvent dlgEnded, WriteableBitmap backgroud = null, Panel panelHolder = null)
		{
			try
			{
				List<TloMedia> itemObject = picsCtrl.ItemObject;
				List<BitmapImage> list = new List<BitmapImage>();
				List<Rect> list2 = new List<Rect>();
				using (List<CirclePagePicItem>.Enumerator enumerator = picsCtrl.mListItems.GetEnumerator())
				{
					while (enumerator.MoveNext())
					{
						CirclePagePicItem current = enumerator.get_Current();
						list.Add(current.imgContent.get_Source() as BitmapImage);
						list2.Add(ToolFunction.GetElementPos(current));
					}
				}
				this.mDlgShow = dlgStart;
				this.mDlgHide = dlgEnded;
				this.mListSnsImg = itemObject;
				this.mListThumbImg = list;
				this.mListOriginPos = list2;
				this.mNFirstPicIndex = nFIndex;
				this.mImgBack = backgroud;
				this.mPanelHolder = panelHolder;
			}
			catch
			{
			}
		}
		public ScrollPicsCtrlArgs(List<TloMedia> listSnsImg, List<BitmapImage> listThumbImg, List<Rect> listOriginPos, int nFirstPicIndex, WriteableBitmap wbBack = null, MMUIEvent dlgStart = null, MMUIEvent dlgEnded = null)
		{
			this.mDlgShow = dlgStart;
			this.mDlgHide = dlgEnded;
			this.mListSnsImg = listSnsImg;
			this.mListThumbImg = listThumbImg;
			this.mListOriginPos = listOriginPos;
			this.mNFirstPicIndex = nFirstPicIndex;
			this.mImgBack = wbBack;
		}
		public static bool CheckIsInfoOk(ScrollPicsCtrlArgs scrollPicsCtrlArgs_0)
		{
			if (scrollPicsCtrlArgs_0 != null && scrollPicsCtrlArgs_0.mListSnsImg != null && scrollPicsCtrlArgs_0.mListThumbImg != null && scrollPicsCtrlArgs_0.mListSnsImg.get_Count() != 0 && scrollPicsCtrlArgs_0.mNFirstPicIndex != -1)
			{
				if (scrollPicsCtrlArgs_0.mListSnsImg.get_Count() == scrollPicsCtrlArgs_0.mListThumbImg.get_Count())
				{
					return !scrollPicsCtrlArgs_0.mBIsNeedAnimation || (scrollPicsCtrlArgs_0.mListOriginPos != null && scrollPicsCtrlArgs_0.mListSnsImg.get_Count() == scrollPicsCtrlArgs_0.mListOriginPos.get_Count());
				}
			}
			return false;
		}
		private void SetImageInfoList(CirclePagePicsCtrl picsCtrl)
		{
			if (picsCtrl != null && picsCtrl.ItemObject != null && picsCtrl.ItemObject.get_Count() != 0)
			{
				this.mListSnsImg = picsCtrl.ItemObject;
				return;
			}
			this.mListSnsImg = null;
		}
	}
}
